package com.wzu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wzu.entity.Menu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface MenuMapper extends BaseMapper<Menu> {
    
    @Select("SELECT * FROM permission WHERE userid = #{userid}")
    Menu getMenuByUserId(String userid);
    
    @Update("UPDATE permission SET user_manage=#{userManage}, permission_manage=#{permissionManage}, " +
            "area_manage=#{areaManage}, disease_info_manage=#{diseaseInfoManage}, " +
            "disease_policy_manage=#{diseasePolicyManage}, insurance_info_input=#{insuranceInfoInput}, " +
            "disease_cert_manage=#{diseaseCertManage}, insurance_payment=#{insurancePayment}, " +
            "disease_reimburse_apply=#{diseaseReimburseApply}, disease_reimburse_audit=#{diseaseReimburseAudit}, " +
            "disease_reimburse_payment=#{diseaseReimbursePayment}, disease_statistics=#{diseaseStatistics}, " +
            "area_statistics=#{areaStatistics} WHERE userid=#{userid}")
    int updateMenu(Menu menu);
} 